package net.acoinWork.dynRender.configParse.propertyModel;

/**
 * @author xusk
 * @date: 16/1/3 上午12:08
 */
public final class Common extends PropertyModel {
    private boolean doDebug = false;
    private Freemarker freemarker;
    private Velocity velocity;

    public boolean isDoDebug() {
        return doDebug;
    }

    public Freemarker getFreemarker() {
        return freemarker;
    }

    public Velocity getVelocity() {
        return velocity;
    }

    @Override
    protected void basicAttribute(String key, String val) {
        doDebug = key.equals("doDebug") ? Boolean.valueOf(val) : doDebug;
    }

    @Override
    protected void complexAttribute(String attrName, String nextParam, String val) {
        if (attrName.startsWith("freemarker")) {
            freemarker = new Freemarker();
            freemarker.deliver(nextParam, val);
        }
        if (attrName.startsWith("velocity")) {
            velocity = new Velocity();
            velocity.deliver(nextParam, val);
        }
    }
}
